package com.example.demo.generator.scaffold.dto;

import com.example.demo.generator.scaffold.model.ScaffoldOptions;

import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;

/**
 * 脚手架生成请求。
 */
public class ScaffoldGenerationRequest {

    @NotBlank
    private String basePackage;

    @NotBlank
    private String moduleName;

    @NotBlank
    private String createTableSql;

    /**
     * 业务模块输出目录（相对 basePackage），例如 modules/asset 或 feature/traceability.
     */
    @JsonProperty("moduleBasePath")
    private String moduleBasePath;

    @Valid
    private ScaffoldOptions scaffoldOptions = ScaffoldOptions.defaultOptions();

    @Valid
    private SqlParseOptions sqlParseOptions = new SqlParseOptions();

    public String getBasePackage() {
        return basePackage;
    }

    public void setBasePackage(String basePackage) {
        this.basePackage = basePackage;
    }

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public String getModuleBasePath() {
        return moduleBasePath;
    }

    public void setModuleBasePath(String moduleBasePath) {
        this.moduleBasePath = moduleBasePath;
    }

    public String getCreateTableSql() {
        return createTableSql;
    }

    public void setCreateTableSql(String createTableSql) {
        this.createTableSql = createTableSql;
    }

    public ScaffoldOptions getScaffoldOptions() {
        return scaffoldOptions;
    }

    public void setScaffoldOptions(ScaffoldOptions scaffoldOptions) {
        this.scaffoldOptions = scaffoldOptions != null ? scaffoldOptions : ScaffoldOptions.defaultOptions();
    }

    public SqlParseOptions getSqlParseOptions() {
        return sqlParseOptions;
    }

    public void setSqlParseOptions(SqlParseOptions sqlParseOptions) {
        this.sqlParseOptions = sqlParseOptions != null ? sqlParseOptions : new SqlParseOptions();
    }
}
